package com.etoak.api;

import com.etoak.common.core.vo.ResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(name = "upload-service")
public interface UploadService {

    /**
     * 文件上传
     * 1 @PostMapping 指定 consumes multipart/form-data
     * 2 MultipartFile 必须添加 @RequestPart
     */
    @PostMapping(value = "/upload/image", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResultVO<String> uploadImage(@RequestPart MultipartFile pic);

}
